package com.tengju.user.domain.model.sign;

import lombok.Getter;

import java.util.Arrays;

@Getter
public enum StarSignTriggerTypeEnum {

    SYS_AUTO(1, "系统自动邀请入星"),
    MANAGE_HANDLE(2, "后台手动邀请入星");


    private int code;
    private String desc;

    private StarSignTriggerTypeEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static StarSignTriggerTypeEnum getByCode(byte code) {
        return Arrays.stream(StarSignTriggerTypeEnum.values()).filter(k->k.getCode() == code)
        .findFirst().orElse(null);
    }

}
